package com.service.business.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.service.business.base.dto.LoginUserSession;
import com.service.business.member.dto.MemberStoreChange;
import com.service.dao.enums.MemberJAType;
import com.service.dao.po.MemberStorePO;
import com.service.dao.model.MemberStore;
import com.service.business.member.controller.rep.MemberStorePageRep;
import com.service.business.member.controller.req.MemberWithdrawReq;
import com.service.business.member.controller.req.TransferAccountReq;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * <dl>
 * <dt>back-end</dt>
 * <dd>Description:</dd>
 * <dd>Copyright: Copyright (C) 2015</dd>
 * <dd>Company: </dd>
 * <dd>CreateDate: 2019年09月24日</dd>
 * </dl>
 *
 * @author
 */
public interface MemberStoreService extends IService<MemberStore> {


    /**
     * 提币操作
     *
     * @param withdrawReq
     */
    void doWithdraw(MemberWithdrawReq withdrawReq);

    List<MemberStorePageRep> listMemberStore();

    List<MemberStorePO> listMemberStore(Integer userId);

    /**
     * 转账
     *
     * @param accountReq
     */
    void transferAccount(TransferAccountReq accountReq,  LoginUserSession user);

    MemberStore getMemberStore(Integer memberId, String coinsName);

    Map<String, BigDecimal> getBalance2Map(Integer memberId);

    void payByMemberStore(Integer memberId, String coinsName, MemberJAType payType, BigDecimal payMoney, Integer orderId);

    void getPointsByPayOrder(Integer memberId, BigDecimal giftPoints, String giftCoins, Integer orderId);

    Integer changeMemberStore(MemberStoreChange memberStoreChange);

    Integer changeMemberStore(MemberStore store, MemberStoreChange storeChange);

    boolean enoughOfBalance(Integer memberId, String coinsName, BigDecimal num);
}
